package com.ruicar.afs.cloud.risk.tortoise.dto.response.apply;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.ruicar.afs.cloud.risk.tortoise.anno.RefData;
import com.ruicar.afs.cloud.risk.tortoise.dto.response.GwtRefData;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * @Description
 * @Author Peng Jinbo
 * @Date 2020/07/27 19:49
 */
@Data
@Builder
@AllArgsConstructor
public class GwtAddress extends GwtRefData implements Serializable {

    /**
     * Address detail
     */
    @JsonInclude
    @JSONField(name = "addressdetail")
    @JsonProperty("addressdetail")
    private String addressDetail;

    /**
     * Post code
     */
    @JsonInclude
    @JSONField(name = "postno")
    @JsonProperty("postno")
    private String postCode;

    /**
     * Start live date
     */
    @JsonInclude
    @JSONField(name = "cdate",format = "yyyy-MM-dd")
    @JsonProperty("cdate")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date startLiveDate;

    /**
     * House type
     */
    @RefData(dicKey = "houseType")
    @JsonInclude
    @JSONField(name = "propertytype")
    @JsonProperty("propertytype")
    private String houseType;

    /**
     * Address type
     */
    @JsonInclude
    @RefData(dicKey = "addressType",translatedKey = "tortoiseAddressType",translatedByKey = true)
    @JSONField(name = "addresstype")
    @JsonProperty("addresstype")
    private String addressType;

    /**
     * Address province
     */
    @JsonInclude
    @RefData(useFieldName = true)
    @JSONField(name = "province")
    @JsonProperty("province")
    private String addressProvince;

    /**
     * Address province name
     */
    @JsonIgnore
    @JSONField(serialize = false)
    private String addressProvinceName;

    /**
     * Address city
     */
    @JsonInclude
    @RefData(useFieldName = true)
    @JSONField(name = "city")
    @JsonProperty("city")
    private String addressCity;

    /**
     * Address city name
     */
    @JsonIgnore
    @JSONField(serialize = false)
    private String addressCityName;

}
